package com.nbsaas.boot.cms.rest.resource;

import com.nbsaas.boot.cms.api.apis.ArticleTagRelationApi;
import com.nbsaas.boot.cms.data.entity.ArticleTagRelation;
import com.nbsaas.boot.cms.api.domain.request.ArticleTagRelationRequest;
import com.nbsaas.boot.cms.api.domain.response.ArticleTagRelationResponse;
import com.nbsaas.boot.cms.api.domain.simple.ArticleTagRelationSimple;
import com.nbsaas.boot.cms.rest.convert.ArticleTagRelationSimpleConvert;
import com.nbsaas.boot.cms.rest.convert.ArticleTagRelationEntityConvert;
import com.nbsaas.boot.cms.rest.convert.ArticleTagRelationResponseConvert;
import com.nbsaas.boot.cms.data.repository.ArticleTagRelationRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   文章标签关联-业务接口实现
*/
@Transactional
@Service
public class ArticleTagRelationResource extends BaseResource<ArticleTagRelation,ArticleTagRelationResponse, ArticleTagRelationSimple, ArticleTagRelationRequest>  implements ArticleTagRelationApi {

    @Resource
    private ArticleTagRelationRepository articleTagRelationRepository;

    @Override
    public JpaRepositoryImplementation<ArticleTagRelation, Serializable> getJpaRepository() {
        return articleTagRelationRepository;
    }

    @Override
    public Function<ArticleTagRelation, ArticleTagRelationSimple> getConvertSimple() {
        return new ArticleTagRelationSimpleConvert();
    }

    @Override
    public Function<ArticleTagRelationRequest, ArticleTagRelation> getConvertForm() {
        return new ArticleTagRelationEntityConvert();
    }

    @Override
    public Function<ArticleTagRelation, ArticleTagRelationResponse> getConvertResponse() {
        return new ArticleTagRelationResponseConvert();
    }




}


